home *** CD-ROM | disk | FTP | other *** search
/ IRIX Patches 1995 June / SGI IRIX Patches 1995 Jun.iso / 5.3_patches / patchSG0000499 / patchSG0000499.idb / usr / include / abi / X11 / Xos.h.z / Xos.h
Encoding:
C/C++ Source or Header  |  1995-06-12  |  3.2 KB  |  161 lines

  1. /*
  2.  * $XConsortium: Xos.h,v 1.49 92/10/18 16:29:27 rws Exp $
  3.  * 
  4.  * Copyright 1987 by the Massachusetts Institute of Technology
  5.  *
  6.  * Permission to use, copy, modify, and distribute this software and its
  7.  * documentation for any purpose and without fee is hereby granted, provided 
  8.  * that the above copyright notice appear in all copies and that both that 
  9.  * copyright notice and this permission notice appear in supporting 
  10.  * documentation, and that the name of M.I.T. not be used in advertising
  11.  * or publicity pertaining to distribution of the software without specific, 
  12.  * written prior permission. M.I.T. makes no representations about the 
  13.  * suitability of this software for any purpose.  It is provided "as is"
  14.  * without express or implied warranty.
  15.  *
  16.  * The X Window System is a Trademark of MIT.
  17.  *
  18.  */
  19.  
  20. /* This is a collection of things to try and minimize system dependencies
  21.  * in a "signficant" number of source files.
  22.  */
  23.  
  24. #ifndef _XOS_H_
  25. #define _XOS_H_
  26.  
  27. #include <X11/Xosdefs.h>
  28.  
  29. /*
  30.  * Get major data types (esp. caddr_t)
  31.  */
  32.  
  33. #ifdef USG
  34. #ifndef __TYPES__
  35. #ifdef CRAY
  36. #define word word_t
  37. #endif /* CRAY */
  38. #include <sys/types.h>            /* forgot to protect it... */
  39. #define __TYPES__
  40. #endif /* __TYPES__ */
  41. #else /* USG */
  42. #if defined(_POSIX_SOURCE) && defined(MOTOROLA)
  43. #undef _POSIX_SOURCE
  44. #include <sys/types.h>
  45. #define _POSIX_SOURCE
  46. #else
  47. #include <sys/types.h>
  48. #endif
  49. #endif /* USG */
  50.  
  51.  
  52. /*
  53.  * Just about everyone needs the strings routines.  We provide both forms here,
  54.  * index/rindex and strchr/strrchr, so any systems that don't provide them all
  55.  * need to have #defines here.
  56.  */
  57.  
  58. #ifndef X_NOT_STDC_ENV
  59.  
  60. #include <string.h>
  61. #ifndef index
  62. #define index strchr
  63. #endif
  64. #ifndef rindex
  65. #define rindex strrchr
  66. #endif
  67.  
  68. #else
  69.  
  70. #ifdef SYSV
  71. #include <string.h>
  72. #define index strchr
  73. #define rindex strrchr
  74. #else
  75. #include <strings.h>
  76. #define strchr index
  77. #define strrchr rindex
  78. #endif
  79.  
  80. #endif /* X_NOT_STDC_ENV */
  81.  
  82.  
  83. /*
  84.  * Get open(2) constants
  85.  */
  86. #ifdef X_NOT_POSIX
  87. #include <fcntl.h>
  88. #ifdef USL
  89. #include <unistd.h>
  90. #endif /* USL */
  91. #ifdef CRAY
  92. #include <unistd.h>
  93. #endif /* CRAY */
  94. #ifdef MOTOROLA
  95. #include <unistd.h>
  96. #endif /* MOTOROLA */
  97. #ifdef SYSV386
  98. #include <unistd.h>
  99. #endif /* SYSV386 */
  100. #include <sys/file.h>
  101. #else /* X_NOT_POSIX */
  102. #if !defined(_POSIX_SOURCE) && defined(macII)
  103. #define _POSIX_SOURCE
  104. #include <fcntl.h>
  105. #undef _POSIX_SOURCE
  106. #else
  107. #include <fcntl.h>
  108. #endif
  109. #include <unistd.h>
  110. #endif /* X_NOT_POSIX else */
  111.  
  112. /*
  113.  * Get struct timeval
  114.  */
  115.  
  116. #ifdef SYSV
  117.  
  118. #ifndef USL
  119. #include <sys/time.h>
  120. #endif
  121. #include <time.h>
  122. #ifdef CRAY
  123. #undef word
  124. #endif /* CRAY */
  125. #if defined(USG) && !defined(CRAY) && !defined(MOTOROLA) && !defined(uniosu)
  126. struct timeval {
  127.     long tv_sec;
  128.     long tv_usec;
  129. };
  130. #ifndef USL_SHARELIB
  131. struct timezone {
  132.     int tz_minuteswest;
  133.     int tz_dsttime;
  134. };
  135. #endif /* USL_SHARELIB */
  136. #endif /* USG */
  137.  
  138. #else /* not SYSV */
  139.  
  140. #if defined(_POSIX_SOURCE) && defined(SVR4)
  141. /* need to omit _POSIX_SOURCE in order to get what we want in SVR4 */
  142. #undef _POSIX_SOURCE
  143. #include <sys/time.h>
  144. #define _POSIX_SOURCE
  145. #else
  146. #include <sys/time.h>
  147. #endif
  148.  
  149. #endif /* SYSV */
  150.  
  151. /* use POSIX name for signal */
  152. #if defined(X_NOT_POSIX) && defined(SYSV) && !defined(SIGCHLD)
  153. #define SIGCHLD SIGCLD
  154. #endif
  155.  
  156. #ifdef ISC
  157. #include <sys/bsdtypes.h>
  158. #endif
  159.  
  160. #endif /* _XOS_H_ */
  161.